﻿namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [Serializable]
    public class TypeWebInputNParam : BaseParam {
        private string webObj = "{webPage}";
        private Element webEle;
        private bool append = true;
        private string inputText;
        //0模拟人工输入，1剪切板输入，2自动化接口输入
        private int inputType = 0;
        //等待元素存在（s）
        private int waitEleTime = 20;
        //模拟手工输入时间间隔（ms）
        private string inputInterval = "50";
        //输入后延时
        private string afterInputDelay = "1";
        //输入前点击元素
        private bool clickBeforeInput = true;

        public string GetTranslateInputType() {
            switch(this.inputType) {
                case 0:
                    return "模拟人工输入";
                case 1:
                    return "剪切板输入";
                case 2:
                    return "自动化接口输入";
                default : return "自动化接口输入";
            }
        }

        public string InputInterval {
            get => inputInterval; 
            set { 
                inputInterval = value;
                NotifyPropertyChanged("InputInterval");
            }  
        }

        public string AfterInputDelay {
            get => afterInputDelay; 
            set { 
                afterInputDelay = value;
                NotifyPropertyChanged("AfterInputDelay");
            }  
        }

        public bool ClickBeforeInput {
            get => clickBeforeInput; 
            set { 
                clickBeforeInput = value;
                NotifyPropertyChanged("ClickBeforeInput");
            }  
        }

        public int WaitEleTime {
            get => waitEleTime; 
            set { 
                waitEleTime = value;
                NotifyPropertyChanged("WaitEleTime");
            }  
        }
        public int InputType { 
            get => inputType;
            set { 
                inputType = value; 
                NotifyPropertyChanged("InputType");
            }
        }

        public bool Append {
            get => append;
            set {
                append = value;
                NotifyPropertyChanged("Append");
            }
        }
        public string WebObj {
            get => webObj;
            set {
                webObj = value;
                NotifyPropertyChanged("WebObj");
            }
        }

        public string InputText {
            get => inputText;
            set {
                inputText = value;
                NotifyPropertyChanged("InputText");
            }
        }
        public Element WebEle {
            get => webEle;
            set {
                webEle = value;
                NotifyPropertyChanged("WebEle");
            }
        }
    }
}
